/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package submarines;

/**
 *
 * @author elad
 */
public class Submarines {
   
   private Square head;
   private int subSize;
   private int numHit;
   private int direction;
   private boolean isalive;
   //private String shipsign;
   //private int subStructure[]; // int array the size of subSize (1 = point hit, 0 point still unharmed)
   
   public Submarines()
    {
        this.head = null;
        this.subSize = 0;
        this.numHit = 0;
    }

    public Submarines(int size, String sign )
    {
        this.subSize=size;
        this.numHit = 0;
        //this.shipsign = sign;
    }
/*
    public Submarines( int size,Square head )
    {
        this.subSize = size ;
        this.head = head ;
    }
     * 
     */
    
    public void setHead(Square head)
    {
        this.head = head;
    }
        
    public void subWasHit()
    {
        this.numHit++;
    }

    public int getSize()
    {
        return subSize;
    }

    public void setSize(int size)
    {
        this.subSize = size;
    }
    
    public void setDirection ( int direction)
    {
        this.direction = direction ;
    }

    public int getDirection ()
    {
        return direction;
    }

    public boolean getIsAlive()
    {
        return isalive;
    }

    public void setIsAlive()
    {
        if(subSize==numHit)
            this.isalive = false;
        else
            this.isalive = true;
    }
}